// 和用户相关的状态管理

import {createSlice} from "@reduxjs/toolkit"


const userStore = createSlice({
    name: "user",
    initialState: {
        token: ""
    },
    reducers: {
        setToken(state, action) {
            state.username = action.payload
        },
    }
})


//解构 actionCreate

const {setToken} = userStore.actions

const userReducer = userStore.reducer

export {setToken}

export default userReducer


